using System;
using System.Data.SqlClient;
using NUnit.Framework;

namespace WebAPI.Dao;

public class DBConnection
{
    private static String Database = "ink_note";
    private static String Username ="sa";
    private static String Password = "123";

    
    // private ISessionFactory _sessionFactory;
    private string ConnectString = "server=.;database=ink_note;uid=" + Username + ";pwd=" + Password;
    private SqlConnection SqlConnection;
    public DBConnection()
    {
        SqlConnection = new SqlConnection(ConnectString);
    }

    public SqlConnection GetConnection()
    {
        SqlConnection.Open();
        return SqlConnection;
    }

    public void Close(SqlConnection connection)
    {
        connection.Close();
    }

}
